/************************************************************
 *  * HONGHE CONFIDENTIAL
 * __________________
 * Copyright (C) 2014-2015 HONGHE Technologies. All rights reserved.
 *
 * NOTICE: All information contained herein is, and remains
 * the property of HONGHE Technologies.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from HONGHE Technologies.
 * The author is knight(卢远强), ios software engineer.
 */
<?php  
require_once("calculator.php");
require_once("PHPUnit.php");

class calculatorTest extends PHPUnit_Framework_TestCase   
    {   
        public $o;   
        //开始的时候初始化一个待测试类   
        function setUp()   
        {   
            $this->o = new calculator();   
        }   
        //最后消亡的时候清除掉这个类   
        function tearDown() {   
                unset($this->o);   
        }   
        function testadd()   
        {   
            $r = $this->o->add(1,2);   
            $e = 3;   
            //assertEquals和assertTrue基本一样，不过这个返回的参数更加详细 			//这里的1+2肯定等于3，我们故意写错看下他的反应。注意这里是故意写错，实际测试时，这些结果必须是完全正确的，因为它的功能就是检测类是否正确. 
            $this->assertEquals($r,$e);   
        }   
        function testadd2()   
        {   
            $r = $this->o->add(102,106);   
            $e = 209;   
            $this->assertTrue($r == $e);   
        }   
           
    }   
	